package com.alibaba.travel.search.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: where
 * @Date: 2023/03/08/17:00
 * @Description:
 */
@Document(indexName = "scenic")
@Data
@ApiModel(description = "ES景点实体类")
public class EsScenic implements Serializable {
    @ApiModelProperty(value="",name="id")
    @Field(type = FieldType.Long)
    private Long id;
    /**
     * 更新时间
     */
    @ApiModelProperty(value="更新时间",name="updateTime")
    @Field(type = FieldType.Date,
            pattern = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private Date updateTime;
    /**
     * 景点名称
     */
    @ApiModelProperty(value="景点名称",name="name")
    @Field(type = FieldType.Keyword)
    private String name;

    /**
     * 创建时间
     */
    @ApiModelProperty(value="创建时间",name="createTime")
    @Field(type = FieldType.Date,
            pattern = "yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private Date createTime;
    /**
     * 景点经度
     */
    @ApiModelProperty(value="景点经度",name="longitude")
    private Double longitude;
    /**
     * 景点纬度
     */
    @ApiModelProperty(value = "景点纬度", name = "latitude")
    private Double latitude;

    @ApiModelProperty(value = "景点纬度 + 经度对象数组")
    private String geoPoint;

    /**
     * 景点价格
     */
    @ApiModelProperty(value="景点价格",name="price")
    @Field(type = FieldType.Double)
    private Double price;
    /**
     * 景点介绍
     */
    @ApiModelProperty(value="景点介绍",name="introduce")
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String introduce;
    /**
     * 景点照片 例如： {"1":"xxx", "2":"xxx"}  转为String
     */
    @ApiModelProperty(value="景点照片 例如:转为String",name="images")
    @Field(type = FieldType.Keyword, index = false)
    private String images;
    /**
     * 景点封面照片
     */
    @ApiModelProperty(value="景点封面照片",name="coverImage")
    @Field(type = FieldType.Keyword, index = false)
    private String coverImage;
    /**
     * mongo内容id
     */
    @ApiModelProperty(value="mongo内容id",name="contentId")
    @Field(type = FieldType.Long, index = false)
    private Long contentId;

    @ApiModelProperty(value="mongo内容")
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private Long content;

    @ApiModelProperty(value="点赞数",name="likesNumber")
    @Field(type = FieldType.Long)
    private Long likesNumber;

    @ApiModelProperty(value="景点评论数")
    @Field(type = FieldType.Long)
    private Long commentNumber = Long.valueOf(0);
}
